#ifndef COOLPOOL_SIMULATION_EIGENTOOLS_H_
#define COOLPOOL_SIMULATION_EIGENTOOLS_H_

#include <eigen3/Eigen/Dense>
#include <MatrixTools.h>
#include <set>

// Container of some functions which does not Eigen provides directly.
namespace coolpool
{
	// Removes all the rows and columns which are not in the set from the given matrix.
	Eigen::VectorXd * sliceVector(const Eigen::VectorXd & vector, std::set<int> s);

	// Removes all the cells of the vector which are not in the set.
	Eigen::MatrixXd * sliceMatrix(const Eigen::MatrixXd matrix, std::set<int> s);

	// Sets zero to the vector.
	void setZero(Eigen::VectorXd * vector);

	// Sets zero the matrix.
	void setZero(Eigen::MatrixXd * matrix);

	double distanceFromCenterSqr(const Eigen::VectorXd & vec);

	// Squared distance between vectors.
	double distanceSqr(const Eigen::VectorXd & vec1, const Eigen::VectorXd & vec2);

	// Distance between vectors.
	double distance(const Eigen::VectorXd & vec1, const Eigen::VectorXd & vec2);
}

#endif
